<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改盲盒管理')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-blindbox-edit" th:object="${tBlindbox}">
            <input name="blindboxId" th:field="*{blindboxId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">盲盒名称：</label>
                <div class="col-sm-8">
                    <input name="blindboxName" th:field="*{blindboxName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">盲盒类型：</label>
                <div class="col-sm-8">
                    <select name="type" class="form-control m-b" th:with="type=${@dict.getType('box_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{type}"></option>
                    </select>
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">成本价格：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="costfee" th:field="*{costfee}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">出售价格：</label>
                <div class="col-sm-8">
                    <input name="sellfee" th:field="*{sellfee}" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">上架数量：</label>
                <div class="col-sm-8">
                    <input name="oncount" th:field="*{oncount}" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">库存数量：</label>
                <div class="col-sm-8">
                    <input name="stockcount" th:field="*{stockcount}" class="form-control" type="number" disabled>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">失效天数：</label>
                <div class="col-sm-8">
                    <input name="failureTime" th:field="*{failureTime}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input name="remark" th:field="*{remark}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "lucky/blindbox";
        $("#form-blindbox-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-blindbox-edit').serialize());
            }
        }

    </script>
</body>
</html>